/*

*** This do file creates the replication results for 

Do bilateral investment treaties increase foreign direct investment to developing countries? (with Laura Spess), World Development, 33 (10), 2005, pp. 1567-1585

Eric Neumayer (LSE)																			

Please report any errors to e.neumayer@lse.ac.uk

*/

use "Article for World Development (BITs).dta", replace

* Table 1
quietly xi: xtreg flnfdiflow96dollars bitsumoecdweighted lnrgdpch lnpop  econgrowth  inflation resourcedepletion agreementwithdevcountry wtomemberdummy  polcon3 bitsumoecdweightedpolcon3 i.year if inc_developing==1, fe
su flnfdiflow96dollars flnfdiflowsharetodevelopingnoneg bitsumoecdweighted lnrgdpch lnpop  econgrowth  inflation resourcedepletion agreementwithdevcountry wtomemberdummy  polcon3 cpr ip gs rule  if e(sample)
corr flnfdiflow96dollars flnfdiflowsharetodevelopingnoneg bitsumoecdweighted lnrgdpch lnpop  econgrowth  inflation resourcedepletion agreementwithdevcountry wtomemberdummy  polcon3 cpr ip gs rule  if e(sample)

* Table 2 RE
quietly xi: xtreg flnfdiflow96dollars bitsumoecdweighted lnrgdpch lnpop  econgrowth  inflation resourcedepletion agreementwithdevcountry wtomemberdummy  polcon3 bitsumoecdweightedpolcon3 i.year if inc_developing==1, fe
est store fixed
xi: xtreg flnfdiflow96dollars bitsumoecdweighted lnrgdpch lnpop  econgrowth  inflation resourcedepletion agreementwithdevcountry wtomemberdummy  polcon3 bitsumoecdweightedpolcon3 i.year if inc_developing==1, re
outreg using c:\table2, replace 3aster
hausman fixed
quietly xi: xtreg flnfdiflow96dollars bitsumoecdweighted lnrgdpch lnpop  econgrowth inflation resourcedepletion agreementwithdevcountry wtomemberdummy  cpr bitsumoecdweightedcpr i.year if inc_developing==1, fe
est store fixed
xi: xtreg flnfdiflow96dollars bitsumoecdweighted lnrgdpch lnpop  econgrowth inflation resourcedepletion agreementwithdevcountry wtomemberdummy  cpr bitsumoecdweightedcpr i.year if inc_developing==1, re
outreg using c:\table2, append 3aster
hausman fixed
quietly xi: xtreg flnfdiflow96dollars bitsumoecdweighted lnrgdpch lnpop  econgrowth inflation resourcedepletion agreementwithdevcountry wtomemberdummy  ip bitsumoecdweightedip i.year if inc_developing==1, fe
est store fixed
xi: xtreg flnfdiflow96dollars bitsumoecdweighted lnrgdpch lnpop  econgrowth inflation resourcedepletion agreementwithdevcountry wtomemberdummy  ip bitsumoecdweightedip i.year if inc_developing==1, re
outreg using c:\table2, append 3aster
hausman fixed
quietly xi: xtreg flnfdiflow96dollars bitsumoecdweighted lnrgdpch lnpop  econgrowth inflation resourcedepletion agreementwithdevcountry wtomemberdummy  gs bitsumoecdweightedgs i.year if inc_developing==1, fe
est store fixed
xi: xtreg flnfdiflow96dollars bitsumoecdweighted lnrgdpch lnpop  econgrowth inflation resourcedepletion agreementwithdevcountry wtomemberdummy  gs bitsumoecdweightedgs i.year if inc_developing==1, re
hausman fixed
outreg using c:\table2, append 3aster
quietly xi: xtreg flnfdiflow96dollars bitsumoecdweighted lnrgdpch lnpop  econgrowth inflation resourcedepletion agreementwithdevcountry wtomemberdummy  rule bitsumoecdweightedrule i.year if inc_developing==1, fe
est store fixed
xi: xtreg flnfdiflow96dollars bitsumoecdweighted lnrgdpch lnpop  econgrowth inflation resourcedepletion agreementwithdevcountry wtomemberdummy  rule bitsumoecdweightedrule i.year if inc_developing==1, re
hausman fixed
outreg using c:\table2, append 3aster

* Table 2 FE
xi: areg flnfdiflow96dollars bitsumoecdweighted lnrgdpch lnpop  econgrowth  inflation resourcedepletion agreementwithdevcountry wtomemberdummy  polcon3 bitsumoecdweightedpolcon3 i.year if inc_developing==1, absorb(country) robust
outreg using c:\table3, replace 3aster
quietly xi: reg flnfdiflow96dollars bitsumoecdweighted lnrgdpch lnpop  econgrowth  inflation resourcedepletion agreementwithdevcountry wtomemberdummy  polcon3 bitsumoecdweightedpolcon3 i.year i.country if inc_developing==1,
*listcoef, help
xi: areg flnfdiflow96dollars bitsumoecdweighted lnrgdpch lnpop  econgrowth inflation resourcedepletion agreementwithdevcountry wtomemberdummy  cpr bitsumoecdweightedcpr i.year if inc_developing==1, absorb(country) robust
outreg using c:\table3, append 3aster
quietly xi: reg flnfdiflow96dollars bitsumoecdweighted lnrgdpch lnpop  econgrowth  inflation resourcedepletion agreementwithdevcountry wtomemberdummy  cpr bitsumoecdweightedcpr i.year i.country if inc_developing==1, 
*listcoef, help
xi: areg flnfdiflow96dollars bitsumoecdweighted lnrgdpch lnpop  econgrowth inflation resourcedepletion agreementwithdevcountry wtomemberdummy  ip bitsumoecdweightedip i.year if inc_developing==1, absorb(country) robust
outreg using c:\table3, append 3aster
quietly xi: reg flnfdiflow96dollars bitsumoecdweighted lnrgdpch lnpop  econgrowth  inflation resourcedepletion agreementwithdevcountry wtomemberdummy  ip bitsumoecdweightedip i.year i.country if inc_developing==1, 
*listcoef, help
xi: areg flnfdiflow96dollars bitsumoecdweighted lnrgdpch lnpop  econgrowth inflation resourcedepletion agreementwithdevcountry wtomemberdummy  gs bitsumoecdweightedgs i.year if inc_developing==1, absorb(country) robust
outreg using c:\table3, append 3aster
quietly xi: reg flnfdiflow96dollars bitsumoecdweighted lnrgdpch lnpop  econgrowth  inflation resourcedepletion agreementwithdevcountry wtomemberdummy  gs bitsumoecdweightedgs i.year i.country if inc_developing==1, 
*listcoef, help
xi: areg flnfdiflow96dollars bitsumoecdweighted lnrgdpch lnpop  econgrowth inflation resourcedepletion agreementwithdevcountry wtomemberdummy  rule bitsumoecdweightedrule i.year if inc_developing==1, absorb(country) robust
outreg using c:\table3, append 3aster
quietly xi: reg flnfdiflow96dollars bitsumoecdweighted lnrgdpch lnpop  econgrowth  inflation resourcedepletion agreementwithdevcountry wtomemberdummy  rule bitsumoecdweightedrule i.year i.country if inc_developing==1, 
*listcoef, help

* Table 3 FE developing country share
xi: areg flnfdiflowsharetodevelopingnoneg bitsumoecdweighted lnrgdpch lnpop  econgrowth  inflation resourcedepletion agreementwithdevcountry wtomemberdummy  polcon3 bitsumoecdweightedpolcon3  if inc_developing==1, absorb(country) robust
outreg using c:\table4, replace 3aster
xi: areg flnfdiflowsharetodevelopingnoneg bitsumoecdweighted lnrgdpch lnpop  econgrowth inflation resourcedepletion agreementwithdevcountry wtomemberdummy  cpr bitsumoecdweightedcpr  if inc_developing==1, absorb(country) robust
outreg using c:\table4, append 3aster
xi: areg flnfdiflowsharetodevelopingnoneg bitsumoecdweighted lnrgdpch lnpop  econgrowth inflation resourcedepletion agreementwithdevcountry wtomemberdummy  ip bitsumoecdweightedip  if inc_developing==1, absorb(country) robust
outreg using c:\table4, append 3aster
xi: areg flnfdiflowsharetodevelopingnoneg bitsumoecdweighted lnrgdpch lnpop  econgrowth inflation resourcedepletion agreementwithdevcountry wtomemberdummy  gs bitsumoecdweightedgs  if inc_developing==1, absorb(country) robust
outreg using c:\table4, append 3aster
xi: areg flnfdiflowsharetodevelopingnoneg bitsumoecdweighted lnrgdpch lnpop  econgrowth inflation resourcedepletion agreementwithdevcountry wtomemberdummy  rule bitsumoecdweightedrule  if inc_developing==1, absorb(country) robust
outreg using c:\table4, append 3aster

